package com.app.demos.util;

import org.apache.http.HttpEntity;
import org.json.JSONObject;

import android.content.Context;
import android.content.SharedPreferences;

import com.app.demos.base.BaseMessage;
import com.app.demos.base.BaseService;

public class AppUtil {
	static public BaseMessage getMessage(String jsonStr) throws Exception {
		BaseMessage message = new BaseMessage();
		JSONObject jsonObject = null;
		try {
			jsonObject = new JSONObject(jsonStr);
			if (jsonObject != null) {
				message.setCode(jsonObject.getString("code"));
				message.setMessage(jsonObject.getString("message"));
				message.setResult(jsonObject.getString("result"));
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

		return message;
	}

	static public String ucfirst(String str) {

		return str;
	}

	public static SharedPreferences getSharedPreferences(BaseService baseService) {
		// TODO Auto-generated method stub
		return null;
	}

	public static SharedPreferences getSharedPreferences(Context ctx) {
		// TODO Auto-generated method stub
		return null;
	}

	public static String getSessionId() {
		// TODO Auto-generated method stub
		return null;
	}

	public static String gzipToString(HttpEntity entity) {
		// TODO Auto-generated method stub
		return null;
	}

	public static boolean isEmptyInt(int taskId) {
		// TODO Auto-generated method stub
		return false;
	}

	public static String md5(String url) {
		// TODO Auto-generated method stub
		return null;
	}

}
